#include <QByteArray>
#include <QXmlAttributes>
#include <QXmlStreamReader>
#include <QString>
#include <QDebug>
#include <QDateTime>

#include "visualkukarobotbackend.h"
#include "Package/kukarsiudpserverdll_global.h"
#include "Package/simpletcpsocketdll_global.h"

visualkukarobotbackend::visualkukarobotbackend(){
    this->mOxfordLaserSensor = GetOxfordLaserSensorInstance();
    this->mSRIForceSensor = GetSRIForceSensorInstance();
    this->mKuKaRsiTTS = GetKuKaRsiTTSInstance();
}

visualkukarobotbackend::~visualkukarobotbackend(){

}

short visualkukarobotbackend::KUKADataRecv(){
    this->mKuKaRsiTTS->KUKADataRecv();
    return 1;
}
short visualkukarobotbackend::KUKADataSend(){
    this->mKuKaRsiTTS->KUKADataSend();
    return 1;
}
short visualkukarobotbackend::KUKAProcess(){
    if(this->KUKADataRecv()){
/*************USERCODE-BEGIN****************/

/**************USERCODE-END*****************/
        this->KUKADataSend();
        return 1;
    }
    return 0;
}


short visualkukarobotbackend::getKUKARIst(double (&KUKARIst)[6]){
   return this->mKuKaRsiTTS->getKUKARIst(KUKARIst);
}
short visualkukarobotbackend::getKUKAAIst(double (&KUKAAIst)[6]){
   return this->mKuKaRsiTTS->getKUKAAIst(KUKAAIst);
}
short visualkukarobotbackend::getKUKAATor(double (&KUKAATor)[6]){
   return this->mKuKaRsiTTS->getKUKAATor(KUKAATor);
}
short visualkukarobotbackend::setKUKARTTS(double KUKARTTS[6]){
   return this->mKuKaRsiTTS->setKUKARTTS(KUKARTTS);
}

short visualkukarobotbackend::ForceSensorConnect(){
    return this->mSRIForceSensor->ForceSensorConnect(4008);
}
void  visualkukarobotbackend::ForceSensorLoopRun(){
    this->mSRIForceSensor->ForceSensorLoopRun();
}
void  visualkukarobotbackend::ForceSensorZeroDeal(){
    this->mSRIForceSensor->ForceSensorZeroDeal();
}
short visualkukarobotbackend::ReadForceSensorData(double (&Data)[6]){
    return this->mSRIForceSensor->ReadForceSensorData(Data);
}

short visualkukarobotbackend::LaserSensorConnect(){
    return this->mOxfordLaserSensor->LaserSensorConnect(5020);
}
void  visualkukarobotbackend::LaserSensorLoopRun(){
    this->mOxfordLaserSensor->LaserSensorLoopRun();
}
short visualkukarobotbackend::ReadLaserSensorData(double (&Data)[8]){
    return this->mOxfordLaserSensor->ReadLaserSensorData(Data);
}
